import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Father{
    public static void main(String[] args) {
    int year = 2020;
    Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, 6-1);
    int maxDate = cal.getActualMaximum(Calendar.DATE);
    int sundays = 0;
        for(int i = 1; i <= maxDate; i ++) {
        cal.set(Calendar.DATE, i);
        if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
            sundays ++;
            if(sundays == 3) {
                break;
            }
        }
    }
    String date = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
        System.out.printf("%s年的父亲节是：%s",year,date);
    //2020年的父亲节是：2020-06-21
}
}
